home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / 8bit / cislib_a / doswiz.doc < prev    next >
Text File  |  1995-04-22  |  17KB  |  558 lines

  1.  
  2.  
  3.  
  4.             DOS WIZARD 
  5.  
  6.    Copyright 1983 by Gary C. Crider 
  7.  
  8. INTRODUCTION 
  9.  
  10.      DOS WIZARD was written to 
  11. accomplish several tasks that no 
  12. other disk utility seemed to address. 
  13. Some of these are listed below.  Some 
  14. knowledge of DOS file structures is 
  15. assumed. There are many good 
  16. tutorials on DOS available (see 
  17. BIBLIOGRAPHY).  IT IS IMPORTANT THAT 
  18. YOU UNDERSTAND WHAT YOU ARE DOING 
  19. WHEN YOU USE DOS WIZARD.  It will be 
  20. one of your handiest utilities, but 
  21. also one of the most potentially 
  22. dangerous if you don't understand it. 
  23. PLEASE READ THIS DOCUMENTATION 
  24. THOROUGHLY! 
  25.    1. RECOVERING THE SECTORS THAT 
  26. JUST SEEM TO VANISH FROM DOS DISKS. 
  27. When a directory listing is produced, 
  28. the sum of all file sectors plus the 
  29. remaining free sectors should total 
  30. 707.  You have probably noticed that 
  31. this is not always true.  The primary 
  32. cause for this is pressing SYSTEM 
  33. RESET while a file is open for 
  34. output.  This leaves the directory 
  35. entry marked open and the file and 
  36. its associated sectors are forever 
  37. lost to DOS. 
  38.       Prior to DOS WIZ the only way 
  39. to reclaim the sectors was to copy 
  40. all good files to another disk, 
  41. reformat the bad disk and selectively 
  42. copy each good file back to the 
  43. reformatted diskette. 
  44.       DOS WIZ will read all files 
  45. while noting the sectors used by the 
  46. files. Any sector not referenced by a 
  47. file entry will be freed into the 
  48. available sectors pool and all open 
  49. file directory entries will be 
  50. released for reuse.   
  51.      2. You probably have received 
  52. the notorious ERROR 164 or ERROR 144 
  53. at one time or another when trying to 
  54. read a disk file. Sometimes you can't 
  55. even delete a file because DOS wants 
  56. a valid file chain before he will 
  57. delete. 
  58.  
  59.  
  60.  
  61.  
  62.      All sectors used by a DOS file 
  63. are chained together, that is, a 
  64. sector of data has a pointer to the 
  65. next sector belonging to that file. 
  66. Also on each sector is a reference to 
  67. the file which owns it. ERROR 164 
  68. indicates that a sector was pointed 
  69. to by a prior sector, but the two 
  70. sectors do not reference the same 
  71. file.  This means that somehow 
  72. another file used a sector belonging 
  73. to the file in question.  ERROR 144 
  74. generally indicates that a sector has 
  75. for some reason become unreadable. 
  76. This can also be the indicated by 
  77. some other error codes. 
  78.       In either case, the integrity 
  79. of the file chain is lost and DOS 
  80. will not be able to read the file. 
  81. Usually there is nothing that can be 
  82. done because a binary load file or a 
  83. tokenized BASIC file that is not 
  84. complete will not be usable in any 
  85. fashion.  However, recovering a 
  86. portion of a data file can be very 
  87. useful at times. It can prevent a lot 
  88. of re-entry of data.  DOS WIZ allows 
  89. recovery of any file up to the point 
  90. where the chain is broken.  This then 
  91. becomes a valid DOS file and can once 
  92. again be accessed. 
  93.      3.  A bad sector on a disk is 
  94. often a big headache even when your 
  95. file is backed up.  It means that all 
  96. good files must be copied and the 
  97. disk reformatted and the good files 
  98. copied back. Only then can you 
  99. restore your file from the backup. 
  100.      DOS WIZ allows another approach 
  101. that is very often successful.  You 
  102. can analyze the disk to get the 
  103. location of the bad sector and it's 
  104. associated file name.  You can then 
  105. write zeros to that sector and the 
  106. odds are very good that you will then 
  107. be able to read it again. If you 
  108. can't you haven't lost anything since 
  109. the sector was unreadable.  You may 
  110. then recover the file up to the point 
  111. of the zero sector and then delete 
  112. the file. Now you can recover the 
  113. sectors used by the file and then 
  114. rewrite your backup file to the disk. 
  115. It sounds complicated, but is really 
  116. quite simple and much easier than the 
  117. alternative discussed earlier. 
  118.  
  119.  
  120.  
  121.  
  122.      4. Occasionally a file gets 
  123. deleted by mistake.  If the sectors 
  124. used by that file have not been 
  125. overwritten, DOS WIZ will allow easy 
  126. recovery of the file. 
  127.      5. Sometimes you end up with two 
  128. or more files of the same name.  If 
  129. you delete or rename one with DOS, 
  130. all files with that name are deleted 
  131. or renamed. DOS WIZ lets you delete 
  132. or rename by file number.  There are 
  133. never duplicate file numbers. 
  134.      6. DOS WIZARD provides a 
  135. translation of the sector bit map 
  136. from the VTOC that is easily 
  137. readable.  It allows you to "hide" 
  138. sectors from use by DOS by marking 
  139. them as allocated.  You can also free 
  140. allocated sectors. 
  141.      7. DOS WIZARD's directory 
  142. listing lists ALL entries including 
  143. deleted and open files.  It allows 
  144. you to perform many DOS functions on 
  145. those files by simply referencing the 
  146. file number.  This does however 
  147. eliminate the use of wild cards.  The 
  148. directory listing also tells you at a 
  149. glance whether any sectors are 
  150. unaccounted for. 
  151.      8. DOS WIZARD will allow you to 
  152. flag sectors as allocated and 
  153. effectively hide them from DOS so 
  154. that they will be reserved for your 
  155. use. 
  156.      9. DOS WIZARD can be used to 
  157. clear unused sectors of data. This 
  158. will speed up the disk duplication 
  159. process when FASTDUP (Copyright 1982 
  160. by Gary C. Crider) is used. 
  161.     10. DOS WIZARD will display 
  162. sectors in hex and ASCII on the same 
  163. screen. It also gives much valuable 
  164. information about that sector such as 
  165. the file to which it belongs. 
  166.     11. DOS WIZARD will list all 
  167. extents by sector range which are 
  168. occupied by a given file.  An extent 
  169. is a set of contiguous sectors. 
  170.  
  171.  
  172.  
  173.  
  174. PRINTING THE DOSWIZ DOCUMENTATION 
  175.  
  176.      Running the DOSWIZ.PRT program 
  177. using BASIC will print the 
  178. DOSWIZ.DOC file in 1.75 width letters 
  179. on a STAR (tm) GEMINI series printer. 
  180. It may work on other printers as 
  181. well. 
  182.      Another way to print it would be 
  183. to use the COPY feature of your DOS 
  184. or DUP.SYS utility, specifying P: as 
  185. the output file name.  It can also be 
  186. printed from most word processors. 
  187. The actual GEMINI control characters 
  188. for page skipping are imbedded in the 
  189. text.  If you have a different brand 
  190. of printer, you may want to change 
  191. them.  They should work okay on the 
  192. EPSON (tm) printers. 
  193.  
  194.  
  195.  
  196.  
  197.  A  DISKETTE ANALYSIS 
  198.  
  199.      This MENU option performs a 
  200. two-stage analysis of the contents of 
  201. a DOS format diskette. Either stage 
  202. may be interrupted by pressing the 
  203. ESC key, but any statistics will only 
  204. be valid up to the point where the 
  205. interrupt occurred. 
  206.      Stage 1 reads all DOS files 
  207. which are not marked as deleted or 
  208. open and verifies that the chain is 
  209. intact. All chain errors are reported 
  210. with the sector number where the 
  211. violation occurred and the file name 
  212. for the chain being validated. A 
  213. chain error is reported if: 
  214.      a) The file number in the sector 
  215. does not reflect the file being 
  216. validated; 
  217.      b) The next sector pointer does 
  218. not point to a valid sector number; 
  219.      c) The sector is not marked as 
  220. allocated in the VTOC; 
  221.      d) A read error occurs while 
  222. trying to read the sector; 
  223.      e) The byte count in the sector 
  224. is less than 1 or greater than 125. 
  225.      Stage 1 reports the following 
  226. counts: 
  227.      1. VALID FILES - the number of 
  228. files which are accessible by DOS and 
  229. contain no chain errors. 
  230.      2. DELETED FILES - the number of 
  231. directory entries flagged as deleted. 
  232.      3. OPEN FILES - the number of 
  233. directory entries flagged as open. 
  234.      4. BAD CHAINS - the number of 
  235. files which were found to have 
  236. invalid chains. 
  237.      5. SECTORS ALLOCATED - the 
  238. number of sectors which are marked as 
  239. allocated in the Volume Table Of 
  240. Contents (VTOC). 
  241.      6. FREE SECTORS - the number of 
  242. sectors marked as not allocated in 
  243. the VTOC. 
  244.      7. DEAD SECTORS - the number of 
  245. sectors allocated less the number of 
  246. sectors validated while verifying 
  247. chains.  These sectors cannot be 
  248. referenced by DOS. 
  249.      Stage 2 reads every sector on 
  250. the diskette and reports the count of 
  251. sectors containing no data (ZERO 
  252. SECTORS) and the count of sectors 
  253. which could not be read (BAD 
  254. SECTORS). 
  255.  
  256.  
  257.  
  258.  
  259.      Stage 2 will list by sector 
  260. number the first 64 bad sectors 
  261. encountered.  If there are more than 
  262. 64 and you need to know where they 
  263. are, consider using FASTDUP. 
  264.  
  265.  C  CHANGE DISKETTES 
  266.  
  267.      This function must be performed 
  268. before processing a different 
  269. diskette since the VTOC and directory 
  270. are re